package thread;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了,请输入暂停几秒:");
        Scanner scanner = new Scanner(System.in);
        int i = scanner.nextInt();
        for(int a = i ; a >= 0 ; a--){
        try {
            Thread.sleep(1000);
            System.out.println(a);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        }
        System.out.println("程序结束了");
    }
}
